var express = require('express');
var router = module.exports =  express.Router();


var _userDao = require('../dao/userDao');
var cookieSession = require('../util/base').cookieSession();

router.use(cookieSession);

// 查询用户信息
router.get('/:id', function(req, resp, next) {
	_userDao.queryUserInfoById(req, resp, next);
});

// 更新用户操作
router.put('/',function (req,resp,next) {
	_userDao.updateUserInfoById(req, resp, next);
});


// 查询关注User和粉丝User
router.get('/attention/:id', function(req, resp, next) {
	_userDao.querySuperiorUserAndFansUser(req, resp, next);
});

// 用户对粉丝的相互关注
router.post('/focus/fans', function(req, resp, next) {
	_userDao.addSuperiorByFansId(req, resp, next);
});